

<div class="row">
	<div class="large-8 large-centered column"  style="margin-top:3rem;">
		<div class="ui attached message">
		  <div class="header">
				Confirm Your Email Address
		  </div>
			<p>To continue, pleaase click on the link we sent to <a href="<?= 'http://www.'.substr(strrchr($account->email, "@"), 1) ?>" target="_blank"><?= $account->email ?></a>. This will confirm on your contatc address. </p>
		</div>
		<div class="ui attached fluid segment">
		  <div class="header">
				<strong>Need Help?</strong>
		  </div>
			<p>Dont have an access to <a  href="<?= 'http://www.'.substr(strrchr($account->email, "@"), 1) ?>"><?= $account->email ?></a>?</p>
			<a href="">Change your contact email</a>
		</div>
		<div class="ui bottom attached warning message">
		  <i class="fa fa-envelope-o"></i>
		  <input type="hidden" id="myEmail" value="<?= $account->email ?>">
		  <input type="hidden" id="myAk" value="<?= $account->activation_key ?>">
		  
		  <a id="resend"  >Resend Confirmation Email</a> 
		</div>
	</div>
</div>	


<script>
	$(document).on('click','#resend',function(){
		$('#loading').foundation('reveal','open');
		var ak = $('#myAk').val();
		var ea = $('#myEmail').val();
		$.ajax({
			url: URL + 'api/email/resend',
			data: {email:ea,activation_key:ak},
			type: 'post',
			dataType: 'json',
			async: true,
			success: function(result)
			{

				
				if(result.status == true)
				{
					 setTimeout(function(){ showSuccesfulMessage("Confirmation Email Sent!","Please check your email",'#error'); $('#error').foundation('reveal','open');  }, 2300);
						
					 setTimeout(function(){ $('#error').foundation('reveal','close') }, 3800);
				}
				else
				{
					showErrorMessage(result.status);
				}
			}
		})
		
	});


$(document).on({
    ajaxStart: function() { $('#loading').foundation('reveal','open'); },
     ajaxStop: function() { setTimeout( "$('#loading').foundation('reveal','close');",2000 ); }    
});

</script>	

